<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
try{
	if(null==request.getSession().getAttribute("userInfo")){
	    out.print("<script>window.location.href='../web/login/login.jsp'</script>");
	}
}catch(Exception e)
{
    out.print("<script>window.location.href='../web/login/login.jsp'</script>");
}

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
   
    
    <title>新建病历</title>
    
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<script type="text/javascript" src="<%=basePath%>scripts/cookie.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FDFDFD;
}
img { border:0}
p {
	margin: 0px;
	padding: 0px;
}
form,input,td,th{ 
border:medium none;
margin: 0;
padding: 0;
} 
ul,li {
	margin: 0px;
	padding: 0px;
	list-style-type: none;
}
input {
	border:0;
	padding:0
}
.logset {
	background-image: url(<%=basePath %>web/resources/images/index-search_02.jpg);
	background-repeat: repeat-x;
	height: 32px;
	width: auto;
	line-height: 32px;
}
.logset a {
	font-size: 13px;
	color: #3399cc;
	display: inline-block;
	float: right;
	margin-right: 30px;
}
.content {
	background-image: url(<%=basePath %>web/resources/images/findCipher_04.png);
	height: 111px;
	background-color: #F9F9F9;
	padding-top: 0px;
	background-repeat: repeat-x;
	padding-left: 30px;
}
.content #search {
	width: 784px;
	height: 41px;
	overflow: hidden;
}
.s_t_wr{
	width:634px;
	height:41px;
	margin-right:8px;
	background-image: url(<%=basePath %>web/resources/images/search-list_06.gif);
	background-repeat: no-repeat;
	float: left;
	padding: 0px;
	background-position: left top;
}
.s_t{
	width:595px;
	height:35px;
	outline:none;
	-webkit-appearance:none;
	font-family: "宋体";
	font-size: 14px;
	line-height: 35px;
	margin-top: 0px;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 34px;
	background-image: url(<%=basePath %>web/resources/images/search-list_06-bg.gif);
	color: #999;
	background-repeat: repeat-x;
	background-position: left 0px;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	padding-top: 5px;
	padding-right: 0px;
	padding-bottom: 5px;
	padding-left: 0px;
}
.s_btn_wr{
	width:142px;
	height:41px;
*position:relative;				z-index:0;
	background-image: url(<%=basePath %>web/resources/images/search-list_08.gif);
	background-repeat: no-repeat;
	float: left;
}
.s_btn{
	width:142px;
	height:41px;
	font-size:0px;
	cursor:pointer;
	background-color: #ddd;
	background-image: url(<%=basePath %>web/resources/images/search-list_08.gif);
	text-decoration: none;
	color: #E4E4E4;
}
.content .but123 {
	float: right;
	display: block;
	height: 41px;
	width: 441px;
	margin-top: 68px;
}
.content .but123 a {
	float: left;
	font-size: 14px;
	color: #3399cc;
	font-weight: bold;
	font-family: "宋体";
	line-height: 41px;
	height: 41px;
	display: inline-block;
	width: 100px;
	text-align: left;
	padding-left: 47px;
	text-decoration: none;
}
.content .but123 .but1 {
	background-image: url(<%=basePath %>web/resources/images/search-list_10.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.content .but123 .but2 {
	background-image: url(<%=basePath %>web/resources/images/search-list_12.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.content .but123 .but3 {
	background-image: url(<%=basePath %>web/resources/images/search-list_14.gif);
	background-repeat: no-repeat;
	background-position: left top;
}
.foot {
	background-image: url(<%=basePath %>web/resources/images/index-search_25.jpg);
	background-repeat: repeat-x;
	background-position: center top;
	height: 150px;
	background-color: #F9F9F9;
	text-align: center;
	padding-top: 39px;
	line-height: 24px;
	font-size: 13px;
	color: #999;
}
.foot p a {
	color: #999;
}
a:link,a:visited{ color:#3399CC; text-decoration:none;}
a:hover{ color:#FF760D; text-decoration:underline;}
-->

</style>
	<script type="text/javascript" src="<%=basePath%>resources/plugin/My97DatePicker/WdatePicker.js"></script>	
<script>
<!--
function settab_zzjsnet(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var zzjs=document.getElementById("zzjs_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  zzjs.style.display=i==cursel?"block":"none";
 }
}

function onlyNum()
{
    if (!((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105)))
    //考虑小键盘上的数字键
        if (event.keyCode != 8)event.returnValue = false;
    //  return false;
}
  function validTextareaLength(){
  	var textareaTag = document.getElementsByTagName("textarea");
  	for(var i=0;i<textareaTag.length;i++){
  		if(textareaTag[i].style.border=='red double'){
			alert('页面中红色区域输入内容过长，请修改！');
			textareaTag[i].focus();
			return false;
  		}
  	}
  	return true;
  }
  function deleFile(){
  	if($("#fileInput").val()!=''){
  		$("#fileInput").hide();
  	}
  }
  function deleFile(){
	  if($("#id").val()!=''){
	  	$("#filename11").hide();
	  }
	  	if($("#fileInput").val()!=''){
	  		$("#fileInput").hide();
	  	}
	  		$("#deleButt").hide();
	  		$("#recoverButt").show();
	  		$("#if_has_File").val('0');
  }
  function recoverFile(){
  	if($("#id").val()!=''){
	  	$("#filename11").show();
	  }
	  	$("#fileInput").show();
	  	$("#deleButt").show();
	 	$("#recoverButt").hide();
	 	$("#if_has_File").val('1');
  }
  function setHiddenInputValue(){
  	$("#if_has_File").val('1');
  	$("#deleButt").show();
  }
  function  modifyPic(id){
  		deleFile();
       $("#modifyPic").html('<input id="fileInput1" type="file" name="imgFile" id="img"/>&nbsp;&nbsp;&nbsp;<input type="button" value="取消" onclick="movePic()"/>');
       $('#'+id).hide();
   }
   function  movePic(){
   		recoverFile();
      var picbtn=document.getElementById("picbtn");
      $("#modifyPic").html('');
      picbtn.style.display='inline';
   }
 
  function zhuxiao(){
	deleteCookie("userName","/");
	deleteCookie("password","/");
	deleteCookie("chkRememberMe","/");
    window.location.href="<%=basePath%>user/qiantanExit.action";
}
</script>
<link href="<%=basePath%>resources/css/bingli.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<%=basePath%>web/case/addCase.js"></script>
</head>

<body>
<jsp:include page="../top.jsp"></jsp:include>
<form action="<%=basePath%>tiCase/addCase.action" method="post" id="myForm" enctype="multipart/form-data">

<div class="hy-wr" align="center">

<div id="lib_zzjs_1"><img src="<%=basePath %>web/resources/images/huiyuan_03.jpg" width="5" height="44" style=" float:left"/>
<div class="lib_menu_zzjsnet ">
<ul>
   <li id="zzjs_11" onclick="settab_zzjsnet('zzjs_1',1,6)" ><a href="<%=basePath%>user/memberInfo.action">会员信息管理</a></li>
   <li id="zzjs_12" onclick="settab_zzjsnet('zzjs_1',2,6)"><a href="<%=basePath%>question/findInfoList.action">发布求诊信息</a></li>
   <li id="zzjs_13" onclick="settab_zzjsnet('zzjs_1',3,6)" class="hover"><a href="<%=basePath%>tiCase/searchMemberCase.action"><font color="#000">我的病历</font></a></li>
   <li id="zzjs_14" onclick="settab_zzjsnet('zzjs_1',4,6)" ><a href="<%=basePath%>stage/dyHelp.action">导医信息</a></li>
   <li id="zzjs_15" onclick="settab_zzjsnet('zzjs_1',5,6)"><a href="<%=basePath %>web/mem/passwordModify.jsp">修改密码</a></li>
   <li id="zzjs_16" onclick="settab_zzjsnet('zzjs_1',6,6)"><a href="javascript:zhuxiao();">安全注销</a></li>
</ul>
</div><img src="<%=basePath %>web/resources/images/huiyuan_08.jpg" width="5" height="44" style="float:left"/>
</div>
 
<div class="lib_Contentbox_zzjs">
<div id="zzjs_zzjs_1_1" style="display:none"></div>
<div id="zzjs_zzjs_1_2">
      <div class="qiehuan"><ul style="margin-left: 471px;">
      <li><a href="<%=basePath %>stage/ctHelp.action">CT上传帮助</a></li>
      <li><a href="<%=basePath %>tiCase/showPage.action?flag=2">发布新病历</a></li>
      <li><a href="<%=basePath%>tiCase/searchMemberCase.action">已发布病历</a></li></ul></div>
      <div class="cont">
     
        <div class="item" style=" height:55px; line-height:55px"> <span class="label1"><strong><font color="red">*</font>选择科室：</strong></span> <span class="input1">
          <s:select list="deplist" name="tiCase.departId" headerKey="" headerValue="--请选择--" listKey="code" listValue="name" 
          			value="tiCase.departId" cssClass="select" id="departId">
          </s:select>
          </span></div>
							<div class="item bgblue">
								<span class="label">姓&nbsp;&nbsp;&nbsp; 名：</span>
								<span class="input1"><input name="tiCase.name"
										maxlength="10" type="text" id="name" value="${tiCase.name}" maxlength="15" />
								</span><span class="label">&nbsp;&nbsp;性&nbsp; 别：</span>
								<span>
								<s:radio list='#{"1":"男","2":"女"}' name="tiCase.sex"></s:radio>
								</span>
								<span class="label">&nbsp;&nbsp;出生年月：</span>
								<span class="input1"><input id="birthday" type="text"
										name="tiCase.birthday" value="<s:date name="tiCase.birthday" format="yyyy-MM-dd"/>"
										onFocus="WdatePicker({firstDayOfWeek:7,dateFmt:'yyyy-MM-dd'})"
										class="Wdate" style="width: 140px" />
								</span><span class="label">&nbsp;&nbsp;年&nbsp;龄：</span>
								<span class="input1"><input name="tiCase.age" value="${tiCase.age}" type="text"
										id="age" style="width: 35px" onkeydown="onlyNum();" maxlength="3"/>
								</span>
							</div>
							<div class="item"> <span class="label">出&nbsp;生&nbsp;地：</span>  <span class="input1">
							<input name="tiCase.bornPlace" value="${tiCase.bornPlace}" maxlength="30" type="text" id="bornPlace" /></span>
							<span class="label">&nbsp;&nbsp;籍&nbsp;&nbsp;贯：</span>
							  <span class="input1"><input name="tiCase.homeTown" maxlength="15" value="${tiCase.homeTown}" type="text" id="textfield" /></span><span class="label">&nbsp;&nbsp;婚&nbsp;&nbsp;姻：</span>  
							  <span class="input1">
							  <s:select list="#{'':'--请选择--','0':'未婚','1':'已婚','2':'离异','3':'丧偶','4':'其他'}" name="tiCase.marriage" theme="simple" value="tiCase.marriage"
				       			 cssStyle="width:100px;" id="marriage"> 
				       		</s:select>
							  </span></div>
        <div class="item bgblue"> 
          <span class="label">身份证号：</span> <span class="input1">
            <input name="tiCase.idcard" value="${tiCase.idcard}" type="text" maxlength="18" id="idcard" />
            </span><span class="label">&nbsp;&nbsp;职&nbsp;&nbsp;业：</span> <span class="input1">
              <input name="tiCase.profession" type="text" value="${tiCase.profession}" id="textfield2"/>
            </span>
        </div>
         
        <div class="item"> <span class="label">现&nbsp;住&nbsp;址：</span> <span class="input1">
          <input  name="tiCase.nowAddress" type="text" value="${tiCase.nowAddress}" maxlength="50" id="textfield3" style=" width:400px"/>
          </span></div>
        <div class="item bgblue"> <span class="label">户口地址：</span> <span class="input1">
          <input name="tiCase.homeAddress"  value="${tiCase.homeAddress}" maxlength="50" type="text" id="textfield4" style=" width:400px"/>
        </span></div>
        <div class="item"> <span class="label">工作单位：</span> <span class="input1">
          <input name="tiCase.workAddress" value="${tiCase.workAddress}" type="text" maxlength="50" id="textfield5" style=" width:400px"/>
        </span></div>
        <div class="item bgblue"> <span class="label">联&nbsp;系&nbsp;人：</span> <span class="input1">
          <input name="tiCase.linkMan" type="text" value="${tiCase.linkMan}" id="textfield6" maxlength="10" />
          </span><span class="label">&nbsp;&nbsp;关&nbsp;&nbsp;系：</span> <span class="input1">
            <input name="tiCase.linkRelation" type="text" value="${tiCase.linkRelation}" id="textfield6" maxlength="10"/>
          </span> </div>
          <div class="item"> <span class="label">地&nbsp;&nbsp;&nbsp;&nbsp;址：</span> <span class="input1">
            <input name="tiCase.address" value="${tiCase.address}"  type="text" id="textfield7" style=" width:280px" maxlength="50"/>
            </span><span class="label">&nbsp;&nbsp;电&nbsp;&nbsp;话：</span> <span class="input1">
              <input name="tiCase.tel"  value="${tiCase.tel}"  type="text" id="textfield7" maxlength="20"/>
          </span></div>
          <div class="item bgblue"> <span class="label">C&nbsp;T&nbsp;上传：</span> <span class="input1">
          <s:if test="flag==2">
	          <c:if test="${tiCase.imgsrc != null}">
	          	<span id="filename11"><a title="点击下载" href="<%=basePath%>tiCase/downloadFile.action?rid=<s:property value="tiCase.id"/>"><s:property value="tiCase.realFileName" /></a></span>
	          	<span id="picbtn"><input type="button" style="margin-left: 400px;"  onclick="modifyPic('picbtn')" value="修改"/></span>
					     <div id="modifyPic"></div>
	          </c:if>
			  <c:if test="${tiCase.imgsrc == null}">
	          	<input id="fileInput" onchange="setHiddenInputValue();" type="file" name="imgFile" style=" width:500px"/>
	          </c:if>
	          <input style="margin-left: 10px;display: none" id="deleButt" onclick="deleFile();" type="button" title="点击删除附件" value="删除附件"/>
	          <input style="margin-left: 20px;display: none" id="recoverButt" onclick="recoverFile();" type="button" title="点击恢复要删除的附件" value="恢复删除"/>
	          <input id="if_has_File" name="if_has_File" type="hidden" />
          </s:if>
          <s:else>
          <span id="filename11"><a title="点击下载" href="<%=basePath%>tiCase/downloadFile.action?rid=<s:property value="tiCase.id"/>"><s:property value="tiCase.realFileName" /></a></span>
        </s:else>
	        </span></div>
          <div class="item2 bgblue"> <span class="label">主&nbsp;&nbsp;&nbsp;&nbsp;诉：</span> <span class="input1">
           <textarea name="tiCase.complaint"  class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.complaint}</textarea>
           </span>
          </div>
          <div class="item2"> <span class="label">现&nbsp;病&nbsp;史：</span> <span class="input1">
           <textarea name="tiCase.disease"class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.disease}</textarea>
           </span>
          </div>
          <div class="item2 bgblue"> <span class="label">既&nbsp;往&nbsp;史：</span> <span class="input1">
           <textarea name="tiCase.pastDisease" class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.pastDisease}</textarea>
             </span>
          </div>
          <div class="item2"> <span class="label">体格检查：</span> <span class="input1">
           <textarea name="tiCase.physical" class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.physical}</textarea>
           </span>
          </div>
          <div class="item2 bgblue"> <span class="label">专科检查：</span> <span class="input1">
           <textarea name="tiCase.screen" class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.screen}</textarea>
           </span>
          </div>
          <div class="item2"> <span class="label">辅助检查：</span> <span class="input1">
           <textarea name="tiCase.examination" class="textarea" cols="45" rows="6" onkeyup="if(this.value.length>450){this.style.border='double red';return false}else{this.style.border='1px #D4D0C8 solid';}">${tiCase.examination}</textarea>
           </span>
          </div>
           	<input type="hidden" id="id" name="tiCase.id" value="${tiCase.id}"/>
		    <input type="hidden" name="tiCase.isRead" value="${tiCase.isRead}"/>
		    <s:if test="flag==2">
	           <div class="item"><div><input type="reset" style="margin-top: 20px;"   class="btn-img" value="重 &nbsp;置"/></div><div >
	           <input type="button" style="margin-top: 20px;cursor:pointer"   onclick="checkSubmit()" class="btn-img" value="提 &nbsp;交"/>
           </s:if>
           </div>
          </div>
          
      </div> </div>
<div id="zzjs_zzjs_1_3"></div>
<div id="zzjs_zzjs_1_4"></div>
<div id="zzjs_zzjs_1_5"></div>
<div id="zzjs_zzjs_1_6"></div>
</div>
<div class="lib-contentbox-zzjsbot"></div>
</div>
<div class="sear3but"><span><strong>快捷导航：</strong></span><a href="<%=basePath %>stage/showHosAll.action">医院检索大全</a> <a href="<%=basePath %>stage/toCase.action">病历填写帮助</a> <a href="<%=basePath %>stage/toDy.action">导医服务</a></div>

<div class="foot">
<p>
					<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);" href="javascript:;">把网站设为主页</a> &nbsp;&nbsp;&nbsp;
					<a href="javascript:window.external.addFavorite(window.location.href,'医生在线');">把网站添加到收藏夹</a>
				</p>
				<p>
					<a href="<%=basePath%>aboutus/show.action?id=1">关于我们</a> |
					<a href="<%=basePath%>aboutus/show.action?id=1">About US</a>
				</p>
				<p>
					<a href="#">&copy;2012 备案号：京ICP证xxxxxxx号</a>
				</p>
</div>
</form>
</body>
</html>
<script>

document.getElementById("zzjs_13").style.backgroundImage = "url('../web/resources/images/huiyuan_06.jpg')";  
  if('<s:property value="tiCase.imgsrc"/>'!=''){
   	$("#deleButt").show();	
   }
</script>